#ifndef SPRING_H
#define SPRING_H

#include "PhysicsParticle.h"

class Spring
{
public:
	Spring();
	Spring(float k, float minLength, float maxLength);

	void Draw();
	void Update();

	void SetParticles(PhysicsParticle* a, PhysicsParticle* b);
	void SetParticleA(PhysicsParticle* p);
	void SetParticleB(PhysicsParticle* p);

	PhysicsParticle*& GetParticleA();
	PhysicsParticle*& SetParticleB();

	float GetK();
	void SetK(float k) {m_k = k;}

	float GetNaturalLength();
	void SetNaturalLength(float length) {m_naturalLength = length;}

	float GetMaxLength();
	void SetMaxLength(float length) {m_maxLength = length;}

	float GetMinLength();
	void SetMinLength(float length) {m_minLength = length;}

private:
	float m_k;
	float m_naturalLength;
	float m_minLength;
	float m_maxLength;
	PhysicsParticle* m_pParticleA;
	PhysicsParticle* m_pParticleB;
};

#endif //SPRING_H